package guimy;

import static net.mindview.util.SwingConsole.run;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

//: gui/HTMLButton.java
// Putting HTML text on Swing components.
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class HTMLButton extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4953575670599232586L;
	private JButton b = new JButton("<html><b><font size=+2>" + "<center>Hello!<br><i>Press me now!");

	public HTMLButton() {
		b.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				add(new JLabel("<html>" + "<i><font size=+4>Kapow!"));
				// Force a re-layout to include the new label:
				validate();
			}
		});
		setLayout(new FlowLayout());
		add(b);
	}

	public static void main(String[] args) {
		run(new HTMLButton(), 200, 500);
	}
} /// :~
